package net.dao.impl;

import java.util.List;

import net.dao.RasgoObjetoDao;
import net.model.RasgoObjeto;

import org.hibernate.Criteria;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

@Repository(value = "rasgoObjetoDao")
public class RasgoObjetoDaoImpl implements RasgoObjetoDao {

	@Autowired
	private SessionFactory sessionFactory;

	@Override
	public List<RasgoObjeto> getAllRasgoObjeto() {
		Criteria criteria = sessionFactory.getCurrentSession().createCriteria(
				RasgoObjeto.class);
		return (List<RasgoObjeto>) criteria.list();
	}

	@Override
	public void saveRasgoObjeto(RasgoObjeto rasgoObjeto) {
		sessionFactory.getCurrentSession().saveOrUpdate(rasgoObjeto);
	}

}
